//
//  CopyMutableCopyModel.m
//  Pthread
//
//  Created by Yanyan Jiang on 2023/2/7.
//  Copyright © 2023 Yanyan Jiang. All rights reserved.
//

#import "CopyMutableCopyModel.h"


@interface CopyMutableCopyModel ()

@end


@implementation CopyMutableCopyModel

- (nonnull id)copyWithZone:(nullable NSZone *)zone {
    CopyMutableCopyModel *person = [CopyMutableCopyModel allocWithZone:zone];
    person.name = self.name;
    return person;
}

- (nonnull id)mutableCopyWithZone:(nullable NSZone *)zone {
    CopyMutableCopyModel *person = [CopyMutableCopyModel allocWithZone:zone];
    person.name = self.name;
    return person;
}



- (void)encodeWithCoder:(nonnull NSCoder *)coder {
    [coder encodeObject:self.name forKey:@"name"];
}

- (nullable instancetype)initWithCoder:(nonnull NSCoder *)coder {
    self.name = [coder decodeObjectForKey:@"name"];
    return self;
}

@end
